/*************************************************************************
 * @file: face.cpp
 * @date: 01/03/2012
 * TOPOL v1_0 - (c)copyright 2012 TEC/UFF
 *************************************************************************
 * This is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 ************************************************************************/

// includes
//----------
#include "face.h"
#include "solid.h"
#include <iostream>


///////////////////////////////////////////////////
///  Constructor and Destructor Implementation  ///
///////////////////////////////////////////////////

//--------------------------------------------------------------------------
Face::Face(Solid* _s)
: floops(NULL)
, flout(NULL)
, nextf( _s->getFace() )
, prevf( NULL )
, m_isSelected( false )
{
  Face* faceOfSolid = _s->getFace();
  if( faceOfSolid )
  {
    faceOfSolid->prevf = this;
  }
  _s->setFace( this );
  fsolid = _s;
}
//--------------------------------------------------------------------------



///////////////////////////////////////
///  PUBLIC Methods Implementation  ///
///////////////////////////////////////

//--------------------------------------------------------------------------
void 
Face::setFaceno(int _f) 
{
		faceno = _f;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
void 
Face::setFlout(Loop* _loop) 
{
		flout = _loop;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
Face* 
Face::getPrevFace()
{
  return prevf;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
Loop* 
Face::getLoopOut()
{
return flout;

}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
Solid* 
Face::getSolid()
{
	return fsolid;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
Face* 
Face::getNextf()
{
	return nextf;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
int 
Face::getFaceno()
{
	return faceno;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
Loop* 
Face::getFloops()
{
	return floops;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
void 
Face::setLoop( Loop* _loop )
{
	floops = _loop;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
void 
Face::setSelection( bool _select )
{
  m_isSelected = _select;
}
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
bool 
Face::isSelected()
{
  return m_isSelected;
}
//--------------------------------------------------------------------------

